package personal.vivian.interf;

import personal.vivian.logic.DataContext;
import personal.vivian.logic.TemplatItem;

import java.lang.reflect.Field;

public class NullAbleValdator implements DataValdator {
    @Override
    public void valdtor(DataContext dataContext, Object val, TemplatItem item) throws Exception{
        Field field=item.getTargetField();
        Object o = field.get(val);
        if(o==null){
            throw new IllegalArgumentException(field.getName()+"不能为空");
        }
    }
}
